import React from 'react';
import {inject, observer} from 'mobx-react';
import {getEcCom, getLabel} from '../../../util/convert';
import EnableProcessInterventionComponents from './EnableProcessInterventionComponents';
import * as type from "../../../constants/type";

@inject('globalStore','freeWorkflowNewStore')
@observer
export default class Main extends React.Component{
    render(){
        const { WeaDialog } = getEcCom();
        const { visible} = this.props;
        let dialogHeight = "600px";
        return (
            <WeaDialog
                visible={visible}
                loadCss={true}
                initLoadCss={true}
                title={getLabel(529887, '流程干预')}
                icon="icon-coms-workflow"
                iconBgcolor='#0079DE'
                maskClosable={false}
                onCancel={this.doCancel.bind(this)}
                style={{width:"720px", height:dialogHeight}}
                layout={jQuery('.wf-req')[0]}
            >
                <EnableProcessInterventionComponents {...this.props} />
            </WeaDialog>
        )
    }
    doCancel(){
        const { controlDialogVisible } = this.props.globalStore;
        controlDialogVisible(type.EnableProcessIntervention,false);
    }
}